home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM28_G.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  5KB  |  89 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM28_G.ASM                                             ;
  3. ;                                                                             ;
  4. ; OS FUNCTION NAME:   enable_DMA_reg_set                                      ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function allows DMA accesses on a specific DMA     ;
  7. ;                     channel to be associated with a specific DMA register   ;
  8. ;                     set.  In a multitasking operating system, when a task   ;
  9. ;                     is waiting for the completion of DMA, it is useful to   ;
  10. ;                     be able to switch to another task until the DMA         ;
  11. ;                     operation completes.  Any DMA on the specified channel  ;
  12. ;                     will go through the specified DMA register set          ;
  13. ;                     regardless of the current register set.  If a DMA       ;
  14. ;                     channel is not assigned to a DMA register set, DMA for  ;
  15. ;                     that channel will be mapped through the current         ;
  16. ;                     register set.                                           ;
  17. ;                                                                             ;
  18. ;           PASSED:   DMA_reg_set:                                            ;
  19. ;                        is the number of the DMA register set to be used for ;
  20. ;                        DMA operations on the DMA channel specified by       ;
  21. ;                        DMA_channel.  If the DMA register set specified is   ;
  22. ;                        zero, no special action will be taken on DMA         ;
  23. ;                        accesses for the DMA channel specified.              ;
  24. ;                                                                             ;
  25. ;                     DMA_channel:                                            ;
  26. ;                        is the DMA channel which is to be associated with    ;
  27. ;                        the DMA map register set specified by DMA_reg_set.   ;
  28. ;                                                                             ;
  29. ;         RETURNED:   status:                                                 ;
  30. ;                        is the status EMM returns from the call.  All other  ;
  31. ;                        returned results are valid only if the status        ;
  32. ;                        returned is zero.  Otherwise they are undefined.     ;
  33. ;                                                                             ;
  34. ; C USE CONVENTION:   unsigned int status;                                    ;
  35. ;                     unsigned int DMA_reg_set;                               ;
  36. ;                     unsigned int DMA_channel;                               ;
  37. ;                                                                             ;
  38. ;                     status = enable_DMA_reg_set (DMA_reg_set,               ;
  39. ;                                                  DMA_channel);              ;
  40. ;-----------------------------------------------------------------------------;
  41. .XLIST
  42. PAGE    60,132
  43.  
  44. IFDEF SMALL
  45.    .MODEL SMALL, C
  46. ENDIF
  47. IFDEF MEDIUM
  48.    .MODEL MEDIUM, C
  49. ENDIF
  50. IFDEF LARGE
  51.    .MODEL LARGE, C
  52. ENDIF
  53. IFDEF COMPACT
  54.    .MODEL COMPACT, C
  55. ENDIF
  56. IFDEF HUGE
  57.    .MODEL HUGE, C
  58. ENDIF
  59.  
  60. INCLUDE emmlib.equ
  61. INCLUDE emmlib.str
  62. INCLUDE emmlib.mac
  63. .LIST
  64. .CODE
  65.  
  66. enable_DMA_reg_set    PROC                                                  \
  67.             DMA_reg_set:WORD,                                     \
  68.             DMA_channel:WORD
  69.  
  70.     ;---------------------------------------------------------------------;
  71.     ;   do;                                                               ;
  72.     ;   .   enable DMA into expanded memory using the DMA register set    ;
  73.     ;   .   specified by the OS;                                          ;
  74.     ;---------------------------------------------------------------------;
  75.     MOVE        AX, enable_dma_on_alt_fcn
  76.     MOVE        BX, DMA_reg_set
  77.     MOVE        DX, DMA_channel
  78.     INT         EMM_int
  79.  
  80.     ;---------------------------------------------------------------------;
  81.     ;   .   return (EMM status);                                          ;
  82.     ;   end;                                                              ;
  83.     ;---------------------------------------------------------------------;
  84.     RET_EMM_STAT    AH
  85.  
  86. enable_DMA_reg_set        ENDP
  87.  
  88. END
  89.